Message Text Control

There is another set of format specifiers that control how text is handled within warning messages. These should appear at the beginning of the format string.

%i(str)

Indent wrapped text: when text is wrapped, it is indented with <str>.

%q

Save the location for the next message (used for %F, %L, %C tests).

%Q

Reset the location for the next message.

%F, %L, %C variables will be set as true for the next message. %Q takes precedence over %q.

%R(n,c)

Print "n" times the character specified by "c".

%s(n)

Limit message size: text is truncated to n characters.

%w(n)

Character wrap: message text wraps at column n.

%W(n)

Word wrap: message text wraps after the last word before column n.

To limit the size of message output to 80 characters per line without word breaks, include the specifier %W(80) in the format string.

The %q and %Q entries can be used to override the default behavior of , or to implement similar functionality from scratch. As an example of %R(num,char) usage:

%?c>0%(%?C%(%R(%C,.)^\n%)%)

This will cause the following display of caret lines:

....................^